package com.jzo2o.health.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.jzo2o.api.trade.enums.PayChannelEnum;
import com.jzo2o.common.model.PageResult;
import com.jzo2o.health.model.domain.Orders;
import com.jzo2o.health.model.dto.request.OrdersPageQueryReqDTO;
import com.jzo2o.health.model.dto.request.OrdersCancelReqDTO;
import com.jzo2o.health.model.dto.request.PlaceOrderReqDTO;
import com.jzo2o.health.model.dto.response.*;
import com.jzo2o.health.model.dto.response.OrdersDetailResDTO;
import com.jzo2o.health.model.dto.response.OrdersPayResDTO;
import com.jzo2o.health.model.dto.response.OrdersResDTO;
import com.jzo2o.health.model.dto.response.PlaceOrderResDTO;

import java.util.List;

public interface IOrdersService extends IService<Orders> {

    PlaceOrderResDTO place(PlaceOrderReqDTO dto);

    OrdersPayResDTO pay(Long id, PayChannelEnum tradingChannel);

    OrdersPayResDTO payResult(Long id);

    PageResult<OrdersResDTO> adminPageQuery(OrdersPageQueryReqDTO ordersPageQueryReqDTO);

    OrdersCountResDTO countByStatus();

    AdminOrdersDetailResDTO aggregation(Long id);
    //用户端取消未支付订单
    void cancel(OrdersCancelReqDTO ordersCancelReqDTO);

    //订单分页查询
    List<OrdersResDTO> findByPage(Integer ordersStatus, Long sortBy);

    //根据订单id查询
    OrdersDetailResDTO detail(Long id);

    //订单退款
    void refund(OrdersCancelReqDTO ordersCancelReqDTO);

}
